{% extends "admin/base.html" %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
{% endblock %}

{% block nav-global %}
    <div id="nav-global">
        <div class="nav-item">
            <a href="{% url 'admin:index' %}">首页</a>
        </div>
        <div class="nav-item">
            <a href="/accounts/admin/feature_switches/" target="_blank">功能开关管理</a>
        </div>
        {% if user.is_superuser %}
        <div class="nav-item">
            <a href="{% url 'admin:accounts_featureswitch_changelist' %}">功能开关设置</a>
        </div>
        {% endif %}
    </div>
{% endblock %}

{% block extrahead %}
    {{ block.super }}
    <style>
        #nav-global {
            background: #417690;
            padding: 0;
            margin: 0;
            display: flex;
            align-items: center;
            height: 40px;
        }
        
        #nav-global .nav-item {
            margin: 0;
            padding: 0;
        }
        
        #nav-global .nav-item a {
            display: block;
            padding: 12px 20px;
            color: #ffc;
            text-decoration: none;
            font-weight: 500;
            transition: background-color 0.3s ease;
            border-right: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        #nav-global .nav-item a:hover {
            background-color: rgba(255, 255, 255, 0.1);
            color: white;
        }
        
        #nav-global .nav-item:last-child a {
            border-right: none;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            #nav-global {
                flex-direction: column;
                height: auto;
            }
            
            #nav-global .nav-item a {
                border-right: none;
                border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            }
        }
    </style>
{% endblock %}